<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性盒子</title>
    <style>
        .box {
            width: 600px;
            display: flex ;
            flex-direction: row;
            border: 1px solid red;
        }
        .box-item {
            flex: 1;
        }
        .box2 {
            width: 600px;
            display: flex ;
            flex-direction: row-reverse;
            border: 1px solid red;
        }
        .box3 {
            width: 600px;
            display: flex ;
            flex-direction: column;
            border: 1px solid red;
        }
        .box4 {
            width: 600px;
            display: flex ;
            flex-direction: column-reverse;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <h3>row（默认值）：主轴为水平方向，起点在左端。</h3>
    <div class="box">
        <div class="box-item">第一个子项</div>
        <div class="box-item">第二个子项</div>
        <div class="box-item">第三个子项</div>
        <div class="box-item">第四个子项</div>
    </div>
    <h3>row-reverse：主轴为水平方向，起点在右端。</h3>
    <div class="box2">
        <div class="box-item">第一个子项</div>
        <div class="box-item">第二个子项</div>
        <div class="box-item">第三个子项</div>
        <div class="box-item">第四个子项</div>
    </div>
    <h3>column：主轴为垂直方向，起点在上沿。</h3>
    <div class="box3">
        <div class="box-item">第一个子项</div>
        <div class="box-item">第二个子项</div>
        <div class="box-item">第三个子项</div>
        <div class="box-item">第四个子项</div>
    </div>
    <h3>column-reverse：主轴为垂直方向，起点在下沿。</h3>
    <div class="box4">
        <div class="box-item">第一个子项</div>
        <div class="box-item">第二个子项</div>
        <div class="box-item">第三个子项</div>
        <div class="box-item">第四个子项</div>
    </div>
</body>
</html>